<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="description" content="准有好事通用跳转测试">
    <link rel="shortcut icon" href="/static/app_link/zyhs_favicon_16.ico">
    <script src="/static/app_link/jweixin-1.6.0.js"></script>
    <title>准有好事通用跳转测试</title>
    <style>
        .show {
            display: block;
        }

        .hidden {
            display: none;
        }
    </style>
</head>
<body>
<h4>v1.3.0 官方直播</h4>
<h5>m站跳转</h5>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('live_official_detail_page?need_auth=0')}" target="_blank">官方优选直播页</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('rtc_with_ta?astr_id=11&need_auth=1')}" target="_blank">找Ta连线(咨询师id=11)</a><br>
<a href="{$m}?app=zyhs&target=flutter&link={:urlencode('root_page?is_show_test=1')}" target="_blank">flutter测试页面</a><br>
<br>
<h5>commonJsToNative跳转</h5>
<button onclick="commonJsToNative('local','live_official_detail_page?need_auth=0')">官方优选直播页</button>
<button onclick="commonJsToNative('local','rtc_with_ta?astr_id=11&need_auth=1')">找Ta连线(咨询师id=11)</button>
<button onclick="commonJsToNative('local','root_page?is_show_test=1')">flutter测试页面</button>

<h4>v1.2.3 增加合盘、骰子、塔罗功能</h4>
<h5>m站跳转</h5>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('composite?need_auth=1')}" target="_blank">合盘首页</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('divination_question?type=0&name1=占星骰子&name2=塔罗占卜&need_auth=0')}" target="_blank">提问仅骰子type=0</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('divination_question?type=1&name1=占星骰子&name2=塔罗占卜&need_auth=0')}" target="_blank">提问仅塔罗type=1</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('divination_question?type=2&name1=占星骰子&name2=塔罗占卜&need_auth=0')}" target="_blank">提问默认骰子type=2</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('divination_question?type=3&name1=占星骰子&name2=塔罗占卜&need_auth=0')}" target="_blank">提问默认塔罗type=3</a><br>
<br>
<h5>commonJsToNative跳转</h5>
<button onclick="commonJsToNative('local','composite?need_auth=1')">合盘首页</button>
<button onclick="commonJsToNative('local','divination_question?type=0&name1=占星骰子&name2=塔罗占卜&need_auth=0')">提问仅骰子type=0</button>
<button onclick="commonJsToNative('local','divination_question?type=1&name1=占星骰子&name2=塔罗占卜&need_auth=0')">提问仅塔罗type=1</button>
<button onclick="commonJsToNative('local','divination_question?type=2&name1=占星骰子&name2=塔罗占卜&need_auth=0')">提问默认骰子type=2</button>
<button onclick="commonJsToNative('local','divination_question?type=3&name1=占星骰子&name2=塔罗占卜&need_auth=0')">提问默认塔罗type=3</button>

<h4>1.2.0</h4>
<h5>准有好事（deeplink 跳转测试）</h5>
<h6>网页直接打开百度</h6>
<a href="https://www.baidu.com">准有好事-打开百度网页</a>
<h6>直接跳转页面</h6>
<a href="{$host}/app_link?app=zyhs&target=link&link=https%3A%2F%2Fwww.baidu.com%3Fneed_auth%3D0">准有好事-打开百度网页</a>
<br>
<a href="{$host}/app_link?app=zyhs&target=local&link=wallet%3Fneed_auth%3D2">准有好事-打开钱包</a>
<h6>universal link</h6>
<a href="https://{$app_link_pre}applink-zyhs.goddessxzns.com?app=zyhs&target=link&link=https%3A%2F%2Fwww.baidu.com%3Fneed_auth%3D0">准有好事-打开百度网页</a>
<br>
<a href="https://{$app_link_pre}applink-zyhs.goddessxzns.com?app=zyhs&target=local&link=wallet%3Fneed_auth%3D2">准有好事-打开钱包</a>
<h6>scheme url</h6>
<a href="zyhs://jump?target=link&link=https%3A%2F%2Fwww.baidu.com%3Fneed_auth%3D0">准有好事-打开百度网页</a>
<br>
<a href="zyhs://jump?target=local&link=wallet%3Fneed_auth%3D2">准有好事-打开钱包</a>

<h5>m站跳转</h5>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('open_mini_wechat?user_name=gh_a8de002cc2e8&path_url_encode=pages%2Fastrologer%2Fuser%2Finfo%2Fcenter%2Findex&mini_program_type=0&need_auth=0')}"
   target="_blank">测试跳转到正式咨询师小程序-个人中心页面</a><br>
<br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=now&date=2020-06-09&hour=13&min=06&need_auth=1')}" target="_blank">跳转到2020-06-09
    13:06的 天象星盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=natal&date=2020-06-09&hour=13&min=06&need_auth=1')}" target="_blank">跳转到本命盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=transits&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09
    13:06的 行运盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=thirdprogressed&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09 13:06的 三限盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=progressions&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09 13:06的 次限盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=solar&date=2020-06-09&hour=13&min=06&need_auth=1')}" target="_blank">跳转到2020-06-09
    13:06的 太阳弧</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=solar_return&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09 13:06的 日返盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=lunar_return&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09 13:06的 月返盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=firdaria&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09
    13:06的 法达盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=profection&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到2020-06-09 13:06的 小限盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=dodekatemorion&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到十二分盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=trimsamsa&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到十三分盘</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrolable?chart=fortune&date=2020-06-09&hour=13&min=06&need_auth=1')}"
   target="_blank">跳转到福点盘</a><br>

<h5>commonJsToNative跳转</h5>
<button onclick="commonJsToNative('local','open_mini_wechat?user_name=gh_a8de002cc2e8&path_url_encode=pages%2Fastrologer%2Fuser%2Finfo%2Fcenter%2Findex&mini_program_type=0&need_auth=0')">
    测试跳转到正式咨询师小程序-个人中心页面
</button>
<button style="margin-top: 20px" onclick="commonJsToNative('local','astrolable?chart=now&date=2020-06-09&hour=13&min=06&need_auth=1')">
    跳转到2020-06-09 13:06的 天象星盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=natal&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到本命盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=transits&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的
    行运盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=thirdprogressed&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09
    13:06的 三限盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=progressions&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的
    次限盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=solar&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的 太阳弧
</button>
<button onclick="commonJsToNative('local','astrolable?chart=solar_return&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的
    日返盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=lunar_return&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的
    月返盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=firdaria&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的
    法达盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=profection&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到2020-06-09 13:06的
    小限盘
</button>
<button onclick="commonJsToNative('local','astrolable?chart=dodekatemorion&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到十二分盘</button>
<button onclick="commonJsToNative('local','astrolable?chart=trimsamsa&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转十三分盘</button>
<button onclick="commonJsToNative('local','astrolable?chart=fortune&date=2020-06-09&hour=13&min=06&need_auth=1')">跳转到福点盘</button>
<h4>跳转到企业微信</h4>
<h5>m站跳转</h5>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('jump_mobile_browser?link=https%3A%2F%2Fwork.weixin.qq.com%2Fca%2Fcawcdef78ab063ba83')}"
   target="_blank">跳转到企业微信</a><br>
<h5>commonJsToNative跳转</h5>
<button onclick="commonJsToNative('local','jump_mobile_browser?link=https%3A%2F%2Fwork.weixin.qq.com%2Fca%2Fcawcdef78ab063ba83')">跳转到企业微信
</button>
<h4>v1.0.0 第一个版本</h4>
<h5>m站跳转</h5>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astrologer_home?id='.$version100.astrologer_home_id.'&need_auth=0')}"
   target="_blank">占星师个人主页(id={$version100.astrologer_home_id})</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('question_detail?qid='.$version100.question_id.'&need_auth=0')}" target="_blank">问答_问题详情(qid={$version100.question_id})</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('chat?id='.$version100.chat_id.'&need_auth=2')}')}" target="_blank">跳转到聊天页面(id={$version100.chat_id})</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('chat_order_detail?id='.$version100.chat_order_detail_id.'&need_auth=2')}')}"
   target="_blank">跳转到连线咨询详情(id={$version100.chat_order_detail_id})</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('hot_question?need_auth=0')}" target="_blank">热门问题-大家都在问</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('wallet?need_auth=2')}" target="_blank">钱包</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('chat_list?need_auth=2')}" target="_blank">连线列表</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('follow_list?need_auth=2')}" target="_blank">关注列表</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('coupon_list?need_auth=2')}" target="_blank">卡券中心</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('recode_list?need_auth=2')}" target="_blank">档案列表</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('message_center?need_auth=2')}" target="_blank">系统消息</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('setting?need_auth=0')}" target="_blank">设置</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('consult_astr_ask?need_auth=2')}" target="_blank">立即咨询</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('jump_mobile_browser?link=https%3A%2F%2Fwww.baidu.com%3Fneed_auth%3D0')}"
   target="_blank">跳转到手机默认的浏览器_打开百度</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('my_question?need_auth=2')}" target="_blank">问答-我的提问</a><br>
<br>
<br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=1&need_auth=0')}" target="_blank">跳转到专区列表_情感倾诉</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=2&need_auth=0')}" target="_blank">跳转到专区列表_感情创伤</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=3&need_auth=0')}" target="_blank">跳转到专区列表_多元专区</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=4&need_auth=0')}" target="_blank">跳转到专区列表_事业工作</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=5&need_auth=0')}" target="_blank">跳转到专区列表_婚姻关系</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=6&need_auth=0')}" target="_blank">跳转到专区列表_财富高度</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=7&need_auth=0')}" target="_blank">跳转到专区列表_双人关系解析</a><br>
<a href="{$m}?app=zyhs&target=local&link={:urlencode('astro_area?type=8&need_auth=0')}" target="_blank">跳转到专区列表_学业成长</a><br>
<br>
<br>
<h5>commonJsToNative跳转</h5>
<button onclick="commonJsToNative('local','astrologer_home?id={$version100.astrologer_home_id}&need_auth=0')">
    占星师个人主页(id={$version100.astrologer_home_id})
</button>
<button onclick="commonJsToNative('local','question_detail?qid={$version100.question_id}&need_auth=0')">
    问答_问题详情(qid={$version100.question_id})
</button>
<button onclick="commonJsToNative('local','chat?id={$version100.chat_id}&need_auth=2')">跳转到聊天页面(id={$version100.chat_id})</button>
<br>
<button onclick="commonJsToNative('local','chat_order_detail?id={$version100.chat_order_detail_id}&need_auth=2')">
    跳转到连线咨询详情{$version100.chat_order_detail_id}
</button>
<br>
<button onclick="commonJsToNative('local','hot_question?need_auth=0')">热门问题-大家都在问</button>
<br>
<button onclick="commonJsToNative('local','wallet?need_auth=2')">钱包</button>
<br>
<button onclick="commonJsToNative('local','chat_list?need_auth=2')">连线列表</button>
<br>
<button onclick="commonJsToNative('local','follow_list?need_auth=2')">关注列表</button>
<br>
<button onclick="commonJsToNative('local','coupon_list?need_auth=2')">卡券中心</button>
<br>
<button onclick="commonJsToNative('local','recode_list?need_auth=2')">档案列表</button>
<br>
<button onclick="commonJsToNative('local','message_center?need_auth=2')">系统消息</button>
<br>
<button onclick="commonJsToNative('local','setting?need_auth=0')">设置</button>
<br>
<button onclick="commonJsToNative('local','back')">触发APP本地返回按钮功能</button>
<br>
<button onclick="commonJsToNative('local','consult_astr_ask?need_auth=2')">立即咨询</button>
<br>
<button onclick="commonJsToNative('local','jump_mobile_browser?link=https%3A%2F%2Fwww.baidu.com%3Fneed_auth%3D0')">
    跳转到手机默认的浏览器_打开百度
</button>
<br>
<button onclick="commonJsToNative('local','my_question?need_auth=2')">问答-我的提问</button>
<br>
<br>
<button onclick="commonJsToNative('local','astro_area?type=1&need_auth=0')">跳转到专区列表_情感倾诉</button>
<button onclick="commonJsToNative('local','astro_area?type=2&need_auth=0')">跳转到专区列表_感情创伤</button>
<button onclick="commonJsToNative('local','astro_area?type=3&need_auth=0')">跳转到专区列表_多元专区</button>
<button onclick="commonJsToNative('local','astro_area?type=4&need_auth=0')">跳转到专区列表_事业工作</button>
<button onclick="commonJsToNative('local','astro_area?type=5&need_auth=0')">跳转到专区列表_婚姻关系</button>
<button onclick="commonJsToNative('local','astro_area?type=6&need_auth=0')">跳转到专区列表_财富高度</button>
<button onclick="commonJsToNative('local','astro_area?type=7&need_auth=0')">跳转到专区列表_双人关系解析</button>
<button onclick="commonJsToNative('local','astro_area?type=8&need_auth=0')">跳转到专区列表_学业成长</button>
<br>
<br>

<h4>commonJsToNativeShare todo</h4>
<button onclick="commonJsToNativeShare('微信分享标题','微信分享描述','http://wwww.baidu.com',0,'','测试所有跳转页')">点击分享到微信</button>
<button onclick="commonJsToNativeShare('微信朋友圈分享标题','微信朋友圈分享描述','http://wwww.baidu.com',1,'','测试所有跳转页')">点击分享到微信朋友圈</button>
<button onclick="commonJsToNativeShare('微博分享标题','微博分享描述','http://wwww.baidu.com',2,'','测试所有跳转页')">点击分享到微博</button>
<button onclick="commonJsToNativeShare('qq分享标题','qq分享描述','http://wwww.baidu.com',3,'','测试所有跳转页')">点击分享到qq</button>
<button onclick="commonJsToNativeShare('qq空间分享标题','qq空间分享描述','http://wwww.baidu.com',4,'','测试所有跳转页')">点击分享到qq空间</button>
<button onclick="commonJsToNativeShare('弹出底部分享view分享标题','弹出底部分享view分享描述','http://wwww.baidu.com',5,'','测试所有跳转页')">弹出底部分享view</button>

<div id="toast" class="hidden"
     style="position: fixed;left: 10px;right: 10px;bottom: 20px;text-align: center;background: rgba(0,0,0,0.5);color: white;font-size: 10px;padding: 20px;border-radius: 10px;word-spacing: normal;word-wrap:break-word;word-break:normal; "></div>

</body>

<script src="/static/jquery-3.1.1.min.js"></script>
<script>
    /**
     * 通用跳转
     * @param target string 跳转方式
     * @param link string 跳转地址
     * @param umeng_event_name string 友盟事件名
     * @param umeng_event_label string 友盟事件参数
     */
    function commonJsToNative(target, link, umeng_event_name, umeng_event_label) {
        console.log('target=' + target + ',link=' + link + ',umeng_event_name=' + umeng_event_name + ',umeng_event_label=' + umeng_event_label)
        var e = event.currentTarget;
        console.error('e=', e); //获取当前元素，类同this
        var dom = e
        console.error('dom=', dom); //获取当前元素，类同this

        umeng_event_name = typeof umeng_event_name === 'undefined' ? '' : umeng_event_name;
        umeng_event_label = typeof umeng_event_label === 'undefined' ? '' : umeng_event_label;
        // if (umeng_event_name) {
        //     umeng_event_label += '-' + link
        // }
        if (!target)
            return
        else if (target === 'link') {
            // link = domain + link
        }


        switch (app_type) {
            case 'ios':
                window.webkit.messageHandlers.commonJsToNative.postMessage({
                    'target': target,
                    'link': link,
                    'umeng_event_name': umeng_event_name,
                    'umeng_event_label': umeng_event_label
                });
                break;
            case 'android':
                console.log('android')
                if (version)
                    androidwebview.commonJsToNative(target, link, umeng_event_name, umeng_event_label)
                else
                    androidwebview.commonJsToNative(target, link)
                break;
            default:
                console.log('error：app_type=', app_type, '（说明没有在App里面打开，那么直接打开universal link页面）');
                window.location.href = "{$m}?app=zyhs&target=" + target + "&link=" + encodeURIComponent(link);
        }
    }

</script>
<script>

    var app_type = '{$app_type}'
    var version = '{$version}'


    function commonJsToNativeTransferData(type, data) {
        var data = {
            'type': type,
            'data': data,
        }
        switch (app_type) {
            case 'ios':
                console.log('ios commonJsToNativeTransferData')
                window.webkit.messageHandlers.commonJsToNativeTransferData.postMessage(data);
                break;
            case 'android':
                console.log('android commonJsToNativeTransferData')
                androidwebview.commonJsToNativeTransferData(JSON.stringify(data))
                break;
            default:
                console.log('commonJsToNativeTransferData not ios or android')
        }
    }

    function commonJsToNativePopInputText(text, placeholder) {
        var data = {
            'text': text,
            'placeholder': placeholder,
        }
        switch (app_type) {
            case 'ios':
                console.log('ios commonJsToNativePopInputText')
                window.webkit.messageHandlers.commonJsToNativePopInputText.postMessage(data);
                break;
            case 'android':
                console.log('android commonJsToNativePopInputText')
                androidwebview.commonJsToNativePopInputText(JSON.stringify(data))
                break;
            default:
                console.log('commonJsToNativePopInputText not ios or android')
        }
    }

    function commonNativeToJsPopInputText(type, text) {
        console.log('\n\n--------------commonNativeToJsPopInputText----------------')
        console.log('commonNativeToJsPopInputText type=', type)
        console.log('commonNativeToJsPopInputText text=', text)
        console.log('--------------commonNativeToJsRequest----------------\n\n')

        var toast = document.getElementById('toast');
        toast.className = 'show';
        toast.innerText = 'text=' + text + '\n' + 'type=' + type;
        setTimeout(function () {
            toast.className = 'hidden';
        }, 5000)
    }


    function commonJsToNativeRequest(method, path, params) {
        var data = {
            'method': method,
            'path': path,
            'params': params,
        }
        switch (app_type) {
            case 'ios':
                console.log('ios commonJsToNativeRequest')
                window.webkit.messageHandlers.commonJsToNativeRequest.postMessage(data);
                break;
            case 'android':
                console.log('android commonJsToNativeRequest')
                androidwebview.commonJsToNativeRequest(JSON.stringify(data))
                break;
            default:
                console.log('commonJsToNativeRequest not ios or android')
        }

    }

    function commonNativeToJsRequest(method, path, params, data) {
        console.log('\n\n--------------commonNativeToJsRequest----------------')
        console.log('commonNativeToJsRequest method=', method)
        console.log('commonNativeToJsRequest path=', path)
        console.log('commonNativeToJsRequest params=', params)
        console.log('commonNativeToJsRequest data=', data)
        console.log('--------------commonNativeToJsRequest----------------\n\n')

        var toast = document.getElementById('toast');
        toast.className = 'show';
        toast.innerText = data;
        setTimeout(function () {
            toast.className = 'hidden';
        }, 5000)
    }

    /**
     * commonJsToNativeShare(title,desc,**url,platform[0：微信；1：微信朋友圈；2：微博；3：qq；4：qq空间]);【注意：banner 跳转的webview 和 服务消息里跳转的webview  要实现的js调用本地分享的方法】
     * @param title
     * @param desc
     * @param url
     * @param platform
     */
    function commonJsToNativeShare(title, desc, url, platform, umeng_event_name, umeng_event_label) {
        switch (app_type) {
            case 'ios':
                window.webkit.messageHandlers.commonJsToNativeShare.postMessage({
                    'title': title,
                    'desc': desc,
                    'url': url,
                    'platform': platform,
                    'umeng_event_name': umeng_event_name,
                    'umeng_event_label': umeng_event_label
                });
                break;
            case 'android':
                console.log('android')
                androidwebview.commonJsToNativeShare(title, desc, url, platform, umeng_event_name, umeng_event_label)
                break;
            default:
                console.log('not ios or android')
        }
    }

</script>
<script>
    wx.config({
        debug: true,
        appId: '{$signPackage.appId}', // 必填，公众号的唯一标识
        timestamp: '{$signPackage.timestamp}', // 必填，生成签名的时间戳
        nonceStr: '{$signPackage.nonceStr}', // 必填，生成签名的随机串
        signature: '{$signPackage.signature}',// 必填，签名
        jsApiList: ['updateTimelineShareData', 'updateAppMessageShareData'], // 必填，需要使用的JS接口列表
        openTagList: [], // 可选，需要使用的开放标签列表，例如['wx-open-launch-app'],
        fail: function (err) {
            console.log('config failed err=', err);
        }
    });

    wx.ready(function () {
        //直接在这里触发唤起
        wx.checkJsApi({
            jsApiList: ['updateTimelineShareData', 'updateAppMessageShareData'], // 需要检测的 JS 接口列表，所有 JS 接口列表见附录2,
            success: function (res) {
                console.log('wxJsApi success:', res)
            }, fail: (err) => {
                console.log('wxJsApi fail:', err)
            }
        });
        wx.updateAppMessageShareData({
            title: '准有好事App全局跳转测试标题', // 分享标题
            desc: '准有好事App全局跳转测试描述', // 分享描述
            link: '{$signPackage.url}', // 分享链接
            imgUrl: 'https://wechat.goddessxzns.com/static/app_link/wechat_share_zyhs.png', // 分享图标
            type: 'link', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                // 用户确认分享后执行的回调函数
                console.log('分享到聊天消息成功');
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
                console.log('分享到聊天消息取消');
            }
        });
        wx.updateTimelineShareData({
            title: '准有好事App全局跳转测试标题', // 分享标题
            link: '{$signPackage.url}', // 分享链接$signPackage.url
            imgUrl: 'https://wechat.goddessxzns.com/static/app_link/wechat_share_zyhs.png', // 分享图标
            success: function () {
                // 用户确认分享后执行的回调函数
                console.log('分享到朋友圈成功');
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
                console.log('分享到朋友圈取消');
            }
        });
        console.log("微信配置成功");
    });
    wx.error(function (res) {
        console.error("微信配置失败：", res);
    });
</script>
{include file="../apps/web/view/public/sensors.html" /}
</html>
